package spring.security.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import spring.security.dao.SysUserMapper;
import spring.security.dto.PageList;
import spring.security.entity.SysUser;
import spring.security.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	//@Autowired
	private SysUserMapper sysUserMapper;
	
	@Override	
	public PageList<List<SysUser>> getInfo() {
		/*SysUser sysUser = new SysUser();
		sysUser.setPkid("1");
		PageHelper.startPage(1, 1);
		Page<List<SysUser>> page = PageHelper.startPage(1, 1)
		.doSelectPage(() -> sysUserMapper.select(sysUser));
		pageList.setContent(page.getResult());
		pageList.setTotal(page.getTotal());*/
		PageList<List<SysUser>> pageList = new PageList<>();
		return pageList;
	}

	@Override
	@Transactional
	public void insert(SysUser sysUser) {
		sysUserMapper.insertSelective(sysUser);
	}

}
